Skip to main content

5.2 Anova

Anova-tests can be viewed as a simplified regression analysis, in which the focus lies in whether the mean value of a dependent continuous variable is different in two or more independent groups given by another categorical variable. One example is to test whether the average salary is different for people with low, medium, and high education (using an independent variable where the level of education is divided into three groups).

An Anova-test can check if there are significant differences between at least two of the groups (given by the independent variable), but it does not indicate which group(s) this applies to. For such purposes, regression analyses need to be performed (see section 5.4).

Syntax:

anova <variable> <variable list> [if <condition>] [, <options>]

If testing two variables only, i.e. one dependent and one independent variable, a one-way Anova-test is performed. It is also possible to test a dependent variable against two independent categorical variables, also called a two-way Anova-test.

Example: